﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WinnerCMS.Data.Mapping
{
    public partial class MessageMap
        : System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WinnerCMS.Model.Message>
    {
        public MessageMap()
        {
            // table
            //ToTable("CMS_Messages");

            // keys
            HasKey(t => t.Id);

            // Properties
            Property(t => t.Id)
                
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
                .IsRequired();
            Property(t => t.Sender)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Incept)
                
                .HasMaxLength(50)
                .IsRequired();
            Property(t => t.Title)
                
                .HasMaxLength(100)
                .IsRequired();
            Property(t => t.Content)
                .IsMaxLength()
                .IsRequired();
            Property(t => t.Flag)
                
                .IsRequired();
            Property(t => t.SendTime)
                
                .IsRequired();
            Property(t => t.IsRead)
                
                .IsRequired();
            Property(t => t.DelSend)
                
                .IsRequired();
            Property(t => t.CloseTime)
                
                .IsOptional();
            Property(t => t.GUID)
                
                .HasMaxLength(50)
                .IsOptional();

            // Relationships

            //InitializeMapping();
        }
    }
}

